package com.itheima.service.impl;

import com.github.pagehelper.PageHelper;
import com.itheima.dao.ProductDao;
import com.itheima.domain.Product;
import com.itheima.service.ProductSercice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductSerciceImpl implements ProductSercice {
    @Autowired
    private ProductDao productDao;
    @Override
    public List<Product> findAllProduct(int page, int pageSize) {
        PageHelper.startPage(page,pageSize);
             return productDao.findAllProduct();
    }

    @Override
    public int saveProduct(Product product) {

        return productDao.saveProduct(product);
    }
}
